<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:jsf="http://xmlns.jcp.org/jsf"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:p="http://primefaces.org/ui">

    <h:form>
        <p:commandButton value="REGRESAR AL LISTADO DE EMPRESAS" 
                         update=":panelContent">
            <f:setPropertyActionListener
                target="#{navigationController.navigationContent}"
                value="./pages/administration/company_view.xhtml" />
        </p:commandButton>
    </h:form>
    <hr />
    <div align="center">
        <h:form>
            <h1><h:outputText value="Crear o Editar una EMPRESA."/></h1>
            <hr/>
            <strong>
                Recuerde que es importante que los datos estén llenados correctamente debido 
                a que los documentos se van a generar de acuerdo a lo llenado es este formulario
            </strong>
            <hr/>
            <p:panelGrid columns="2" style="width: 100%;">

                <p:outputLabel value="Name:" for="name" />
                <p:inputText id="name" value="#{shopRoleController.company.name}" title="Name" required="true" class="form-control"/>
                <p:outputLabel value="Ruc:" for="ruc" />
                <p:inputText id="ruc" value="#{shopRoleController.company.ruc}" title="Ruc" required="true" class="form-control"/>
                <p:outputLabel value="Phone:" for="phone" />
                <p:inputText id="phone" value="#{shopRoleController.company.phone}" title="Phone" class="form-control"/>
                <p:outputLabel value="Address:" for="address" />
                <p:inputText id="address" value="#{shopRoleController.company.address}" title="Address" required="true" class="form-control"/>
                <p:outputLabel value="Contact:" for="contact" />
                <p:inputText id="contact" value="#{shopRoleController.company.contact}" title="Contact" class="form-control"/>
            </p:panelGrid>
            <hr/>
            <p:commandButton value="Guardar" action="#{shopRoleController.saveOrUpdateCompany()}"
                             update="@form" />
        </h:form>

    </div>
</ui:composition>
